package com.youlei.newgraduateproject.service.impl;

import com.youlei.newgraduateproject.dao.EmployeesMapper2;
import com.youlei.newgraduateproject.dynamic.datasource.annotation.DataSource;
import com.youlei.newgraduateproject.entity.Employees2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author youlei
 * @since 2021-05-08
 */
@Service
public class EmployeesServiceImpl2 {

    @Resource
    EmployeesMapper2 employeesMapper2;

    @DataSource("slave1")
    public Employees2 getById(Integer id){
        Employees2 employees2 = employeesMapper2.getById(id);
        return employees2;
    }
}
